<template>
  <div id="app" ref="app">
    <router-view />
  </div>
</template>

<script>
import { ebookMixin } from "./utils/mixin";
export default {
  mixins: [ebookMixin],
  watch: {
    offsetY(v) {
      // 监听下拉的变化
      if (v > 0) {
        this.$refs.app.style.backgroundColor = "black";
      }
    }
  }
};
// 动态的设置根元素的字体大小
document.addEventListener("DOMContentLoaded", () => {
  const html = document.querySelector("html");
  let fontSize = window.innerWidth / 10;
  fontSize = fontSize > 50 ? 50 : fontSize;
  html.style.fontSize = fontSize + "px";
});
</script>

<style lang="scss" scoped>
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
</style>
